home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 72 / MOBICLIC 72.ISO / mac / DATA / TCHATCHE / doggy2004.cst / 00427_Script_427 < prev    next >
Text File  |  2005-02-02  |  2KB  |  94 lines

  1. -- gestion des drapeaux
  2. property s, nom,dernierSon
  3. global langue, pistePremierDrapeau,laboActif,sonIntLangues
  4. global interLangues
  5.  
  6. on beginSprite me
  7.   s = me.SpriteNum
  8.   nom = sprite(s).member.name
  9.   LC = nom.char[nom.char.count]
  10.   if LC = "a" then pistePremierDrapeau = s
  11.   suff = suffixeLangue()
  12.   if LC = suff then
  13.     sprite(s).member = member("drapeau1" & LC)
  14.   else
  15.     sprite(s).member = member("drapeau0" & LC)
  16.   end if
  17. end
  18.  
  19. on MouseEnter me
  20.   if _movie.pauseState() then exit
  21.   if interLangues=0 then exit
  22.   if laboActif=1 then exit
  23.   if controleTcha03()=0 then exit
  24.   if sprite(s).member.name contains "drapeau1" then exit
  25.   
  26.   _player.cursor(280)
  27.   sprite(s).member = nom & "_" & suffixeLangue() & "_1"
  28.   
  29.   -- jouer le son correspondant au bouton
  30.   if sound(3).status = 3 then exit
  31.   if sonIntLangues = 0 then exit
  32.   LBout = ["Drapeau0d","Drapeau0a","Drapeau0b","Drapeau0c"]
  33.   p = getPos(LBout,nom)
  34.   if p<>0 then nomSon = "bout" & string(p+6)
  35.   memSon = dernierSon
  36.   sound(4).volume = sound(3).volume
  37.   sound(4).playFile("@/sons_tchatche/" & nomSon & suffixeLangue())
  38.   dernierSon = memSon
  39. end
  40.  
  41. on mouseLeave
  42.   if _movie.pauseState() then exit
  43.   if interLangues=0 then exit
  44.   if laboActif=1 then exit
  45.   if controleTcha03()=0 then exit
  46.   cursor -1
  47.   if sprite(s).member.name contains "drapeau1" then exit
  48.   sprite(s).member = nom & "_" & suffixeLangue()
  49.   coupeSon 4
  50. end
  51.  
  52. on mouseUp me
  53.   if laboActif=1 then exit
  54.   if interLangues=0 then exit
  55.   if controleTcha03()=0 then exit
  56.   if _mouse.mouseV<455 then exit
  57.   
  58.   _player.cursor(-1)
  59.   lettreLangue = the last char of nom
  60.   L = ["a","b","c","d"]
  61.   langue = getPos(L,lettreLangue)
  62.   nomD = nom
  63.   put "1" into char 8 of nomD
  64.   sprite(s).member = nomD & "_" & suffixeLangue() & "_2"
  65.   majDrapeaux
  66.   choixLangue
  67. end
  68.  
  69. on majDrapeaux
  70.   compteur=0
  71.   repeat with i = pistePremierDrapeau to pistePremierDrapeau+3
  72.     compteur = 1+compteur
  73.     if compteur<>langue then
  74.       nomD = sprite(i).member.name
  75.       if nomD contains "Drapeau" then
  76.         LC = nomD.char[9]
  77.         sprite(i).member = member("drapeau0" & LC)
  78.       end if
  79.     end if
  80.   end repeat
  81. end
  82.  
  83. -- empΩcher le chgt de langue pendant un jeu tcha03
  84. on controleTcha03
  85.   if _movie.name contains "03" then
  86.     if _movie.frame > label("0") and _movie.frame < label("fin") then
  87.       return 0
  88.     else
  89.       return 1
  90.     end if
  91.   else
  92.     return 1
  93.   end if
  94. end